package edu.nakan.day6demo;

/**
 * @author PHUNG Nam Can - NakanPhung
 * @mail cank56hua@gmail.com
 * @date Jul 26, 2013 7:19:11 PM
 * @project Day6Demo
 * @file SortName.java
 */

public class SortName {
	public static void main(String[] args) {
		String[] name = { "Phung Nam Can", "Chu Hoang Son", "Chu Hoang Can",
				"Mai Ngoc Thao", "Do Tien Dung", "Nguyen Tien Dung",
				"Nguyen Huu Dung", "Tran Khac Con" };
		String temp = new String();
		for (int i = 0; i < name.length; i++) {
			for (int j = 0; j < name.length; j++) {

				if (name[i].compareTo(name[j]) < 0) {
					temp = name[i];
					name[i] = name[j];
					name[j] = temp;

				}
			}

		}

		for (int i = 0; i < name.length; i++) {
			System.out.println(name[i]);
		}

	}

}
